﻿@{
    var returnUrl = Url.Action("Connect", "Connect", new { Area = "Piedone.Facebook.Suite.Connect", ReturnUrl = Model.ReturnUrl });
}

<a href="#" id="facebook-connect-link" class="piedone-facebook-suite-connect connect-link">
    @T("Attach your Facebook account to your username for simple login")
</a>

@using (Script.Foot())
{
    <script type="text/javascript">
        $(document).on("facebook:ready", function () {
            $.facebookConnect.initializeLogin("@Url.Encode(returnUrl)", "@Model.Permissions", "@Url.Action("SaveSession", "Connect", new { Area = "Piedone.Facebook.Suite.Connect" })", "@Html.AntiForgeryTokenValueOrchard()");
        });
    </script>
}